home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / QuickDraw / Bitblitz 1.0 / LibHeaders / ColorTools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-09  |  2.9 KB  |  109 lines  |  [TEXT/KAHL]

  1. #ifndef __COLORTOOLS__
  2. #define __COLORTOOLS__
  3.  
  4. /*---------------------------------------------------------------------------------------
  5. //    File:    ColorTools.h    
  6. //    Date:    February 15, 1989    
  7. //
  8. //    by Mike Puckett, Macintosh CPU Software Quality, x4-1332.
  9. //    © 1989 - 1990, Apple Computer, Inc.
  10. //---------------------------------------------------------------------------------------
  11. */
  12.  
  13. /* Useful Definitions -------------------------------------------------------------------
  14. */
  15. #define hilite        (short)50                /* This should be defined in QuickDraw.h!    */
  16. #define dither        (short)64                /* Only if Jackson Pollock is around.        */
  17.  
  18. #define FULL_HUE    (unsigned short)0xFFFF
  19. #define NO_HUE        (unsigned short)0x0000 
  20.  
  21.  
  22. /* Useful Macros ------------------------------------------------------------------------
  23. */
  24. #define ISCGRAFPORT(grafPtr)    (TEST_FLAG(((GrafPtr)grafPtr)->portBits.rowBytes,0xC000))
  25. #define PM_ROWBYTES(rb)            ((unsigned short)0x8000 | (rb))
  26.  
  27.  
  28. /* Useful In-Lines ----------------------------------------------------------------------
  29. */
  30. pascal unsigned long
  31. QDVersion(void) = 
  32. {    0x7014,    /* Moveq    #$14,D0    */
  33.     0xAB1D    /* _Offscreen        */
  34.     };
  35.  
  36. /* Data Structures ----------------------------------------------------------------------
  37. */
  38. typedef struct
  39. {    RGBColor    mTtlColor,
  40.                 mBkGColor,
  41.                 mBarColor,
  42.                 mItmColor,
  43.                 mItmMark,
  44.                 mItmCmnd;
  45.     }
  46. MColorsType;
  47.  
  48.  
  49. #ifdef __safe_link
  50. extern "C" {
  51. #endif
  52.  
  53. extern pascal    void    InitColorTools(                        void);
  54.  
  55. /* General Purpose Routines -------------------------------------------------------------
  56. */
  57. extern pascal    Boolean    HasColorQD(                            void);
  58.  
  59. extern pascal    Boolean    Has32BitQD(                            void);
  60.  
  61. extern pascal    void    HiliteRect(            Rect            *theRect);
  62.  
  63. extern pascal    void    HiliteRoundRect(    Rect            *theRect,
  64.                                             short            ovalWidth,
  65.                                             short            ovalHeight);
  66.  
  67. extern pascal    void    HiliteRgn(            RgnHandle        theRgn);
  68.  
  69. extern pascal    Boolean    PlotIcls(            Rect            *theRect,
  70.                                             ResType            iclsType,
  71.                                             short            iclsID);
  72.  
  73. extern pascal    void    PixToBits(            PixMapHandle    pmHandle,
  74.                                             BitMap            *bitMap);
  75.  
  76.  
  77. extern pascal    void    GetColorEntry(        CTabHandle        theCTable,
  78.                                             short            theType,
  79.                                             RGBColor        *colorEntry);
  80.                                             
  81. /* Window-Oriented Routines -------------------------------------------------------------
  82. */
  83. extern pascal void        GetWColor(            WindowPtr        theWindow,
  84.                                             short            theType,
  85.                                             RGBColor        *theColor);
  86.     
  87. /* Control-Oriented Routines ------------------------------------------------------------
  88. */
  89. extern pascal void        GetCtlColor(        ControlHandle    theControl,
  90.                                             short            theType,
  91.                                             RGBColor        *theColor);
  92.                                     
  93. /* Menu-Oriented Routines ---------------------------------------------------------------
  94. */
  95. extern pascal void        SetMenuItemColor(    short            menuID,
  96.                                             short            menuItem,
  97.                                             RGBColor        *itemColor);
  98.  
  99. extern pascal void        GetMColors(            short            menuID,
  100.                                             short            menuItem,
  101.                                             MColorsType        *mColors);
  102.  
  103.  
  104. #ifdef __safe_link
  105. }
  106. #endif
  107.  
  108.  
  109. #endif